-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to CMake #35
base: main
Are you sure you want to change the base?
Switch to CMake #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming that we'll use a series of different PRs, it's probably best to remove the empty CMakeLists.txt
files that have been added here.
We also need to decide how we'll properly set the default data directory and VERSION using CMake.
src/CMakeLists.txt
Outdated
|
||
FILE(GLOB h_files "${CMAKE_CURRENT_SOURCE_DIR}/*.h") | ||
FILE(GLOB c_files "${CMAKE_CURRENT_SOURCE_DIR}/*.C") | ||
SET(EXECUTABLES ${c_files}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SET(EXECUTABLES ${c_files}) | |
SET(SOURCE_FILES ${c_files}) |
src/CMakeLists.txt
Outdated
add_subdirectory(DataLib) | ||
|
||
# Add all source files | ||
add_executable(alara ${EXECUTABLES}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to match the change above
add_executable(alara ${EXECUTABLES}) | |
add_executable(alara ${SOURCE_FILES}) |
src/input.C
Outdated
@@ -1,7 +1,7 @@ | |||
/* $Id: input.C,v 1.14 2007-12-20 22:03:56 wilsonp Exp $ */ | |||
#include "alara.h" | |||
#include "input_tokens.h" | |||
#include "dflt_datadir.h" | |||
//#include "dflt_datadir.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we successfully figured out how to generate this file with CMake as we were doing with autotools?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have put this info in config.h
instead (that is current generated from version.h.in
). We can probably delete this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking pretty good. A few additional comments:
- I think we should rename
version.h.in
toconfig.h.in
since it is used to generateconfig.h
. Be sure to update the line insrc/CMakeLists.txt
as well - We can delete
version.h
entirely as we no longer use it - I don't think we need the symbolic link from
src/DataLib/alara.h
tosrc/alara.h
. If something isn't working we probably need to fix it in CMake
4 .We probably need to add CMake options to setxsdir
andnonxsdir
so that they can be set properly inconfig.h
src/CMakeLists.txt
Outdated
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) | ||
configure_file(version.h.in "${CMAKE_CURRENT_SOURCE_DIR}/config.h") | ||
|
||
FILE(GLOB h_files "${CMAKE_CURRENT_SOURCE_DIR}/*.h") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't use this variable, so probably don't need this line.
src/input.C
Outdated
@@ -1,7 +1,7 @@ | |||
/* $Id: input.C,v 1.14 2007-12-20 22:03:56 wilsonp Exp $ */ | |||
#include "alara.h" | |||
#include "input_tokens.h" | |||
#include "dflt_datadir.h" | |||
//#include "dflt_datadir.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have put this info in config.h
instead (that is current generated from version.h.in
). We can probably delete this line.
@gonuke I believe everything is done but before I push just wanted to clarify two things from the latest comments you had made.
|
The symbolic link looks like an extra file that appears in the repository. It's actually not directly related to your changes, but I think that your changes make it less necessary. You should be able to set the value of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting close but we need to discuss "DFLT_XSDIR" and "DFLT_DATADIR"
@@ -12,4 +11,7 @@ add_subdirectory(DataLib) | |||
|
|||
# Add all source files | |||
add_executable(alara ${SOURCE_FILES}) | |||
target_link_libraries(alara DataLib) | |||
|
|||
# Set direcotry variable names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
# Set direcotry variable names | |
# Set directory variable names |
target_link_libraries(alara DataLib) | ||
|
||
# Set direcotry variable names | ||
set(DFLT_XSDIR ${xsdir}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will do what it needs to do - we should discuss (see note in Slack)
@@ -0,0 +1,10 @@ | |||
# CMake file in the DataLib direcotry within the src directory | |||
|
|||
FILE(GLOB h_files "${CMAKE_CURRENT_SOURCE_DIR}/*.h") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that you need h_files
defined.
So far I have successfully built the
src
directory using CMake. The next step is to do the same for the rest of the sub directories.